package com.jzhao.jpre.comm.http.ws.DataType;

import java.util.ArrayList;

public class ResultSets {
	private ResultField[] fields;
	private ResultDetail[][] details;
	
	public void initFields(int count) {
		fields = new ResultField[count];
	}
	public void initDetails(int count, int detail) {
		details = new ResultDetail[count][detail];
	}
	public ResultField[] getFields() {
		return fields;
	}
	public void setFields(ArrayList fieldList) {
		fields = new ResultField[fieldList.size()];
		for (int i = 0; i < fieldList.size(); i++) {
			fields[i] = (ResultField) fieldList.get(i);
		}
	}
	public ResultDetail[][] getDetails() {
		return details;
	}
	public void setDetails(ArrayList detailList) {
		details = new ResultDetail[detailList.size()][];
		for (int i = 0; i < detailList.size(); i++) {
			//details[i] = (ResultDetail[]) ((ArrayList) detailList.get(i)).toArray();
			ArrayList list = (ArrayList) detailList.get(i);
			details[i] = new ResultDetail[list.size()];
			for (int j = 0; j < list.size(); j++) {
				details[i][j] = (ResultDetail) list.get(j);
			}
		}
	}
}
